﻿using System;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace K9Nano.IM.Models
{
    public class ChatMessage : PersistPoco
    {
        [Display(Name = "消息")]
        [Required(AllowEmptyStrings = false)]
        public string Message { get; set; }

        [Display(Name = "类型")]
        [Required]
        public EChatMessageType Type { get; set; }
        
        [Display(Name = "发送方")]
        [Required]
        public Guid FromId { get; set; }

        [Display(Name = "发送方")]
        public virtual User From { get; set; }

        [Display(Name = "接受方")]
        [Required]
        public Guid ToId { get; set; }

        [Display(Name = "接收方")]
        public virtual User To { get; set; }

        [Display(Name = "会话")]
        [Required]
        public Guid? SessionId { get; set; }

        [Display(Name = "会话")]
        public virtual ChatSession Session { get; set; }
    }
}